#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/shm.h>


int main(){
    int shmid;
    int key ;
    key = ftok("./server.c",'a');
    if(key < 0){
        perror("ftok error\n");
        exit(1);
    }
    printf("ftok key=%d\n",key);
    shmid = shmget(key,128,0777);
    if(shmid < 0){
        printf("error shmgi\n");
        exit(0);
    }
    printf("shmget =%d\n",shmid);
    system("ipcs -m");
    return 0;
}
